import React, { Component } from 'react'
import {connect} from "react-redux"
import {bindActionCreators} from "redux"
import * as action from "../action"
 class Study extends Component {
  changeAge(){
    this.props.setaGE("21")
  }
  render() {
    return (
      <div>{this.props.name} {this.props.age}
        <button onClick={this.changeAge.bind(this)}>改变年龄</button>
      </div>
    )
  }
}
let mapStateToProps = (state)=>{
    return {
      ...state.hotReducer
    }
}
let mapDispacthToprops = (dispatch)=>bindActionCreators(action,dispatch)
export default  connect(mapStateToProps,mapDispacthToprops)(Study)